Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(config): add descriptions to all configuration variables and tests #682

Conversation

onyedikachi-david
Copy link

@onyedikachi-david onyedikachi-david commented Oct 11, 2024

Closes #40

/claim #40

Changes proposed

  • Added descriptions to all configuration variables in OpalClientConfig
  • Added descriptions to all configuration variables in OpalServerConfig
  • Added descriptions to all configuration variables in OpalCommonConfig
  • Created a test to ensure all configuration variables have descriptions

Check List (Check all the applicable boxes)

  • I sign off on contributing this submission to open-source
  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarised content.
  • The title of my pull request is a short description of the requested changes.

Copy link

netlify bot commented Oct 11, 2024

Deploy Preview for opal-docs canceled.

Name Link
🔨 Latest commit f38be07
🔍 Latest deploy log https://app.netlify.com/sites/opal-docs/deploys/670cb6503eea510008cf6b54

@onyedikachi-david
Copy link
Author

The PR is ready for review @gemanor

Copy link
Collaborator

@gemanor gemanor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a good start, but the descriptions need to be much more descriptive. I left two examples (but there are more). Please fix them, and commit again.

POLICY_STORE_URL = confi.str(
"POLICY_STORE_URL",
"http://localhost:8181",
description="URL of the policy store"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is exactly what written on the key, please explain more...

INLINE_OPA_ENABLED = confi.bool(
"INLINE_OPA_ENABLED",
True,
description="Whether to run OPA inline within OPAL"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even the code comment has more description of this description. The task is to write descriptions of the variables, not just mark them as solved. Please do some understanding work around OPAL, and explain the configuration variables in a concise but descriptive way.

@onyedikachi-david
Copy link
Author

It is a good start, but the descriptions need to be much more descriptive. I left two examples (but there are more). Please fix them, and commit again.

Done.

@onyedikachi-david
Copy link
Author

@gemanor Please review.

@onyedikachi-david
Copy link
Author

Hi @gemanor, I don't know if you have got time to review this.

1 similar comment
@onyedikachi-david
Copy link
Author

Hi @gemanor, I don't know if you have got time to review this.

@danyi1212 danyi1212 closed this Dec 24, 2024
Copy link

@iwphonedo iwphonedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david nice job. Please see my comments inside. Almost there. good luck and don't hesitate to contact me for any help needed.

"POLICY_STORE_TYPE",
PolicyStoreTypes,
PolicyStoreTypes.OPA,
description="Specifies the type of policy store to use. Currently supports OPA (Open Policy Agent) and Cedar. This determines how OPAL interacts with the policy engine."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david I would add how it affects the interaction.

@@ -65,14 +74,14 @@ class OpalClientConfig(Confi):
"attempts": 5,
"wait_time": 1,
},
description="retry options when connecting to the policy source (e.g. the policy bundle server)",
description="Retry options when connecting to the policy source (e.g., the policy bundle server). Configures how OPAL handles connection failures when fetching policy updates."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david wait time in seconds

INLINE_CEDAR_ENABLED = confi.bool(
"INLINE_CEDAR_ENABLED",
True,
description="Determines whether OPAL should run the Cedar agent inline within its own container. Similar to INLINE_OPA_ENABLED, but for Cedar policy engine."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david please add if both options could be enabled at the same time opa and cedar

)

OPAL_CLIENT_STAT_ID = confi.str(
"OPAL_CLIENT_STAT_ID",
None,
description="Unique client statistics identifier",
description="Unique identifier for client statistics. This can be used to track and differentiate between multiple OPAL clients in a distributed setup."
)

OPA_HEALTH_CHECK_POLICY_PATH = "engine/healthcheck/opal.rego"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david missing here

@@ -5,18 +5,24 @@
from opal_common.confi import Confi, confi

_LOG_FORMAT_WITHOUT_PID = "<green>{time}</green> | <blue>{name: <40}</blue>|<level>{level:^6} | {message}</level>\n{exception}"
_LOG_FORMAT_WITH_PID = "<green>{time}</green> | {process} | <blue>{name: <40}</blue>|<level>{level:^6} | {message}</level>\n{exception}"
_LOG_FORMAT_WITH_PID = "<green>{time}</green> | {process} | <blue>{name: <40></blue>|<level>{level:^6} | {message}</level>\n{exception}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david why > and not }?

POLICY_REPO_MANIFEST_PATH = confi.str(
"POLICY_REPO_MANIFEST_PATH",
"",
"Path of the directory holding the '.manifest' file (new fashion), or of the manifest file itself (old fashion). Repo's root is used by default",
"Path to the directory containing the '.manifest' file, or to the manifest file itself. "
"The manifest file is used to specify which files in the repo should be treated as policies.",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david where is the spec about that file, and its content format?

"LEADER_LOCK_FILE_PATH", "/tmp/opal_server_leader.lock"
"LEADER_LOCK_FILE_PATH",
"/tmp/opal_server_leader.lock",
description="Path to the leader lock file. Used in multi-server setups to determine the primary server."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david multi server might be a bit confusing. I think this is for the number of uviworkers in the server, to set the process that is the leader. am I right?

)
POLICY_BUNDLE_GIT_ADD_PATTERN = confi.str(
"POLICY_BUNDLE_GIT_ADD_PATTERN",
"*",
description="File pattern to add files to git default to all the files (*)",
description="File pattern to add files to git. Default is all files (*).",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david not clear what is this? which files are added to git?


SCOPES_REPO_CLONES_SHARDS = confi.int(
"SCOPES_REPO_CLONES_SHARDS",
1,
description="The max number of local clones to use for the same repo (reused across scopes)",
description="The maximum number of local clones to use for the same repo (reused across scopes). This helps in managing multiple scopes efficiently."

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david this one needs more explanation. what are those shards and their relationship to the scopes


# Policy refresh configuration
POLICY_REFRESH_INTERVAL = confi.int(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onyedikachi-david isn't this POLICY_REPO_POLLING_INTERVAL? What is the difference between the two?

@onyedikachi-david
Copy link
Author

@iwphonedo, I thought it's closed. Even though I open a PR first and my re-review request was pending when the other PR was opened. Should I reopen?

@iwphonedo
Copy link

@onyedikachi-david send like another PR was already merged for this. Sorry I didn't notice prior to my review. Best

@onyedikachi-david
Copy link
Author

Okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go over all OPAL's config variables and add descriptions
4 participants